package br.com.fidalgotecnologia.layar.json;


import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import br.com.fidalgotecnologia.layar.entity.Action;

public class ActionJsonArray {
	private static ActionJsonArray instance;

	public static ActionJsonArray getInstance() {
		if(instance == null){
			instance = new ActionJsonArray();
		}
		return instance;
	}
	public JSONArray toArray(List<Action> listAction){
		JSONArray ActionArray = new JSONArray();
		for(Action action : listAction){
			JSONObject actionJson = ActionJson.getInstance().toObject(action);
			ActionArray.put(actionJson);
		}
		return ActionArray;
	}
	
	
	
}
